/*    */ package com.feeyin.radar.sys.controller;
/*    */ 
/*    */ import com.feeyin.radar.commons.BigDecimalPropertyEditor;
/*    */ import com.feeyin.radar.sys.form.SaleStageForm;
/*    */ import com.feeyin.radar.sys.service.SaleStageSetService;
/*    */ import java.math.BigDecimal;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.springframework.web.bind.ServletRequestDataBinder;
/*    */ import org.springframework.web.servlet.ModelAndView;
/*    */ import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
/*    */ import org.springframework.web.servlet.view.RedirectView;
/*    */ 
/*    */ public class SaleStageSetController extends MultiActionController
/*    */ {
/*    */   private SaleStageSetService saleStageSetService;
/*    */   private String saleStageSet;
/*    */   private String updateSaleStage;
/*    */ 
/*    */   public SaleStageSetService getSaleStageSetService()
/*    */   {
/* 32 */     return this.saleStageSetService;
/*    */   }
/*    */   public void setSaleStageSetService(SaleStageSetService saleStageSetService) {
/* 35 */     this.saleStageSetService = saleStageSetService;
/*    */   }
/*    */   public String getSaleStageSet() {
/* 38 */     return this.saleStageSet;
/*    */   }
/*    */   public void setSaleStageSet(String saleStageSet) {
/* 41 */     this.saleStageSet = saleStageSet;
/*    */   }
/*    */   public String getUpdateSaleStage() {
/* 44 */     return this.updateSaleStage;
/*    */   }
/*    */   public void setUpdateSaleStage(String updateSaleStage) {
/* 47 */     this.updateSaleStage = updateSaleStage;
/*    */   }
/*    */ 
/*    */   public ModelAndView display(HttpServletRequest request, HttpServletResponse response)
/*    */   {
/* 52 */     Map map = new HashMap();
/* 53 */     map.put("avgSingle", this.saleStageSetService.getAvgSingle());
/* 54 */     map.put("saleStages", this.saleStageSetService.getSaleStages());
/* 55 */     return new ModelAndView(getSaleStageSet(), map);
/*    */   }
/*    */ 
/*    */   public ModelAndView preUpdateSaleStage(HttpServletRequest request, HttpServletResponse response)
/*    */   {
/* 60 */     Map map = new HashMap();
/* 61 */     map.put("result", request.getParameter("result"));
/* 62 */     map.put("avgSingle", this.saleStageSetService.getAvgSingle());
/* 63 */     map.put("saleStages", this.saleStageSetService.getSaleStages());
/* 64 */     return new ModelAndView(getUpdateSaleStage(), map);
/*    */   }
/*    */ 
/*    */   public ModelAndView updateSaleStage(HttpServletRequest request, HttpServletResponse response, SaleStageForm saleStageForm)
/*    */   {
/* 69 */     boolean result = false;
/* 70 */     int success = 0;
/* 71 */     if (saleStageForm != null) {
/* 72 */       result = this.saleStageSetService.insertSaleStage(saleStageForm);
/* 73 */       if (result) success = 1;
/*    */     }
/* 75 */     return new ModelAndView(new RedirectView("./saleStageSet.do?action=preUpdateSaleStage&result=" + success));
/*    */   }
/*    */ 
/*    */   protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception
/*    */   {
/* 80 */     binder.registerCustomEditor(BigDecimal.class, new BigDecimalPropertyEditor());
/*    */   }
/*    */ }

/* Location:           C:\Users\e547415\MyProject\rone\WEB-INF\classes\
 * Qualified Name:     com.feeyin.radar.sys.controller.SaleStageSetController
 * JD-Core Version:    0.6.0
 */